<script setup>
import { getMachineOutValue2 } from "@/api/decision/production";
import { fontSize } from "@/utils/globalMethod";
import moment from "moment";

const config = ref({
  unit: "小时",
  data: [],
  rowNum: 8,
});

const loadData = async () => {
  const { data, total } = await getMachineOutValue2({
    date: [moment().format("YYYYMMDD"), moment().format("YYYYMMDD")],
  });

  config.value.data = data.map((item) => {
    return {
      name: `<div class="ps_text_ellipsis" style="text-align: center;width:100px;" > ${item.UName} </div> `,
      value: item.sjgs,
    };
  });
};

onMounted(loadData);
</script>

<template>
  <div class="ps_w_h_100">
    <div class="board-title">今日机台工作小时</div>

    <dv-scroll-ranking-board
      :config="config"
      :style="{ fontSize: fontSize(0.12) }"
    />
  </div>
</template>

<style scoped lang="scss"></style>
